﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using WebInterface;

namespace WebServices
{
    public class ScopedService : IScopedService
    {
        private readonly ISingleService _singleService;

        public ScopedService(ISingleService singleService)
        {
            _singleService = singleService;
        }

        public async Task<string> DoSomeVeryLongThing(string stringParameter, int intParameter)
        {
            await Task.Delay(100);
            return $"{stringParameter} : {intParameter}";
        }

        public int GetRandomNumber()
        {
            Random random = new Random();
            return random.Next(3, 12);
        }

        public string GetParameter()
        {
            return _singleService.ReturnCurrentMessage();
        }
    }
}
